home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_23_1988_Transactor_Publishing.d64
/
automata 64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
4KB
|
126 lines
10 gosub 650
20 automata 64 by ian adam
30 :
40 : main loop
50 :
60 print tab(6)r$"[145]":input"code";r$
70 a=5887:for i=1 to 10
80 poke a+i,val(mid$(r$,i,1)) and 3
90 next
100 :
110 print "seed value 1[157][157][157]";:input b$
120 if val(b$)=0 then 250
130 print "position (1-40) 20[157][157][157][157]";:input a
140 gosub 540:for i=8192 to 8504 step 8:poke i,0:next
150 poke 8184+8*a,val(b$) and 255
160 :
170 sys 5900
180 :
190 for i=0 to 999:if peek(k) then 240
200 next:gosub 590:print"m more of this p print this
210 [153]"s new seed r random seed
220 print"c new code a automatic codes
230 [153]"v view plot q quit";
240 [146] k,7:[161] b$
250 [129] i[178]1 [164] 7:[139] [202]("srmcapq",i,1) [179][177] b$ [167] [130]
260 [145] i [137] 290,310,330,370,390,490,610
270 [141] 540:[137] 190
280 :
290 [141] 590:[137] 110:[162] seed
300 :
310 r[178]255:[150] [165]s(x)[178][187](x)[172]r:[137] 340:r[175]om seed
320 :
330 r[178]7687:[150] [165]s(x)[178][194](r[170]x):[143] copy last line
340 [129] i[178]8192 [164] 8504 [169] 8
350 [151] i,[165]s(i):[130]:[141] 540:[137] 170
360 :
370 [141] 590:[137] 60:[162] code
380 :
390 [141] 540:r[178]255:[129] j[178]0 [164] 1:r$[178]"":[143] automatic
400 [129] l[178]5888 [164] 5897:a[178][187](l)[172]4
410 [151] l,a:r$[178]r$[170][199](48[170]a):[130]
420 :
430 [129] l[178]8192 [164] 8504 [169] 8
440 [151] l,[187](l)[172]r:[130]
450 :
460 [158] 5900
470 j[178][194](k):[130]:[151] k,0:[137] 190
480 :
490 [141] 540:a$[178][199](10):[159] 4,4,5:[143] 2nd addrs grafix, no lf
500 [157] 4:[158] 6060
510 [153]a$a$[199](14)"code: "r$a$a$
520 [152]4:[160] 4:[137] 190
530 :
540 [139] [194](v)[178]59 [167] [142]
550 [151] v,59:[151] v[170]5,216:[151] v[170]7,24:[143] hires
560 [153]"cont";:[129] i[178]1 [164] 111:[153]"---------";:[130]
570 [151] 2023,173:[151] 56295,14:[142]:col[176]s
580 :
590 [151] v,27:[151] v[170]5,200:[151] v[170]7,21:[153]:[142]:text
600 :
610 [158] 65409:[128]
620 :
630 : start[171]up
640 :
650 [151] 53280,0:[151] 53281,0:[151] 46,64:[156]:k[178]198:v[178]53265
660 :
670 [153]"load cellular automata for the 64
680 print"this program creates complex
690 [153]"geometric artforms on the screen.
700 print"the image is generated line-by-line
710 [153]"according to these rules:
720 print"[158]- a pixel has a colour value 0,1,2,3
730 [153]"- add the values of 3 adjoining pixels
740 print" in a line.
750 [153]"- the sum (0-9) is used to select a
760 print" new colour from the code you specify.
770 [153]"- this new colour is plotted as the
780 print" pixel directly below.
790 [153]"- the code has 10 digits, corresponding
800 print" to the 10 values of the sum (0-9).
810 [153]"automata were introduced in scientific
820 print"american in 1971 & 1984, and a version
830 [153]"appeared in byte magazine in 1986. this
840 print"enhanced version for the 64 is by
850 [153]"ian adam & transactor magazine, 1987.
860 if peek(5900)-160 then gosub 1100
870 print"[158]press return!":input a$
880 :
890 print"[147] instructions:
900 [153]"you enter a 10-digit rule, using
910 print"the digits 0, 1, 2, and 3.
920 [153]"next, enter a seed value which
930 print"is plotted on the top line.
940 [153]"if you enter r, a random seed is used.
950 print"if you enter a seed #, you must
960 [153]"also supply its position on the line.
970 print"[158]after plotting, press:
980 [153]"- s enter a new seed
990 print"- r for a random seed
1000 [153]"- m more of the same plot
1010 print"- c enter new code
1020 [153]"- a automatic code generation
1030 print"- p send pattern to printer
1040 [153]"- q quit
1050 print"the current code will be shown like
1060 [153]"this. make any changes & press return:
1070 r$="0120123123
1080 [137] 60
1090 :
1100 [129] i[178]5900 [164] 6132:[135] a:[151] i,a:[130]
1110 [142]
1120 :
1130 [131]160,32,132,251,132,253,160,1,132,252,136,132,250,162,199,134,166,162
1140 [131]39,134,167,132,169,177,250,133,168,165,167,240,4,160,8,177,250,10
1150 [131]38,168,42,38,168,42,41,3,133,170,160,4,169,0,38,168,42,38
1160 [131]168,42,72,101,170,101,169,170,165,170,133,169,104,133,170,189,0,23
1170 [131]6,254,6,254,5,254,133,254,136,208,221,145,252,24,198,167,16,40
1180 [131]162,2,181,250,41,7,201,7,240,15,56,181,250,233,55,149,250,181
1190 [131]251,233,1,149,251,208,6,246,250,208,2,246,251,202,202,240,223,198
1200 [131]166,208,144,96,162,2,181,250,105,8,149,250,144,3,246,251,24,202
1210 [131]202,240,241,76,35,23,27,65,8,13,10,27,75,64,1,0,160,32
1220 [131]132,251,160,0,132,250,160,25,132,252,160,0,185,162,23,32,210,255
1230 [131]200,192,9,208,245,160,40,132,253,160,7,177,250,162,7,42,118,166
1240 [131]202,16,250,136,16,243,169,7,170,56,101,250,133,250,144,2,230,251
1250 [131]181,166,32,210,255,202,16,248,198,253,208,217,198,252,208,196,96